package com.woniu.new_orange.personnel_model_wu.service.impl;

import com.woniu.new_orange.entity.User;
import com.woniu.new_orange.mapper.UserMapper;
import com.woniu.new_orange.personnel_model_wu.Dto.UserDto;
import com.woniu.new_orange.personnel_model_wu.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Program: new_orange->UserServiceImpl
 * @Description:
 * @Author: donghang
 * @Date: 2023-01-14 09:50
 * @Version： 1.0
 **/
@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserMapper userMapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return 0;
    }

    @Override
    public int insert(User record) {
        return 0;
    }

    @Override
    public int insertSelective(User record) {
        return userMapper.insertSelective(record);

    }

    @Override
    public User selectByPrimaryKey(Long id) {

        return userMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(User record) {

        return userMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(User record) {
        return 0;
    }


    @Override
    //  董航  2023/1/16 12:12  用户登录
    public User userLogin(UserDto userDto) {
        return userMapper.userLogin(userDto);
    }

    @Override
    public User loginByEmail(UserDto userDto) {
        return userMapper.loginByEmail(userDto);
    }

    @Override
    public User loginByPhone(UserDto userDto) {
        return userMapper.loginByPhone(userDto);
    }

    //  董航  2023/2/6 15:55  通过手机获得user对象
    @Override
    public User loginBySms(String userPhone) {
        return userMapper.loginBySms(userPhone);
    }
}
